//
//  UIViewController+ZBRoute.m
//  ZBNavigator
//
//  Created by xzb on 2018/5/30.
//

#import "UIViewController+ZBRoute.h"
#import <objc/message.h>

static const void *kProperty_params = &kProperty_params;

@implementation UIViewController (ZBRoute)

- (void)setZbPageResultBlock:(ZBPageResultBlock)pageResultBlock
{
    objc_setAssociatedObject(self, @selector(zbPageResultBlock), pageResultBlock, OBJC_ASSOCIATION_COPY_NONATOMIC);
}

- (ZBPageResultBlock)zbPageResultBlock
{
    return objc_getAssociatedObject(self, @selector(zbPageResultBlock));
}

- (void)setParams:(NSDictionary *)params
{
    objc_setAssociatedObject(self, kProperty_params, params, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

- (NSDictionary *)params
{
    return objc_getAssociatedObject(self, kProperty_params);
}

- (BOOL)canOpenControllerWithParams:(NSDictionary *)params
{
    return YES;
}

@end
